<div id="quickAdd">
<?
	echo $form->create('Purchase');
?>
	<div class="mainFields"><h3>Details</h3><?
		echo $form->input('description');
		echo $form->input('to');
		echo $form->input('amount', array('label' => $Settings['currency_symbol']));
		echo $form->input('payment_type_id');
		echo $form->input('date', array('type' => 'text', 'value' => $time->format('d/m/Y', time())));
		echo $form->submit('Save');
		?>
	</div>
	<div id="categories">
		<?
		$i = 1;
		foreach($catTypes as $ct => $cats) {
			?><div id="<?= $ct ?>" class="categoryType">
			<h3><?= ucfirst($ct) ?> Categories</h3>
			<ul><?
				foreach($cats as $c) {
					?><li><div class="category">
					<label for="category<?= $c['Category']['id'] ?>" accessKey="<?= $c['Category']['access_key'] ?>">
						<input type="radio" name="data[Purchase][category_id]" value="<?= $c['Category']['id'] ?>" id="category<?= $c['Category']['id'] ?>" />
						<?= $c['Category']['name'] ?>
					</label>
					</div></li><?
				}
			?></ul></div><?
		}
		?>
		<div class="clearing"></div>
		<div id="newCategory"><h4>New Category</h4>
			<label for="category0">
				<input type="radio" name="data[Purchase][category_id]" value="0" id="category0" />
				New Category
			</label>
			<?
			echo $form->input('new_category_name', array('label'=>''));
		?>
		</div>

	</div><?

	echo $form->end();

	?>
</div>


<div id="recentPurchases">
	<h3>Recent Purchases</h3>
	<?
	echo $this->renderElement('purchases', array('purchases' => $purchases));

	echo $html->link('View all purchases', array('controller'=>'purchases', 'action'=>'index'))
	?>

</div>
